package com.xio.cloud.controller;

import com.xio.cloud.domain.CommonResult;
import com.xio.cloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author xio
 * @description 订单控制层
 * @date 2020/9/29 1:23
 */
@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("/payment/get/{id}")
    public CommonResult get(@PathVariable("id") Long id){
        log.info("- - - - - in feign order get - - - ");
        return paymentFeignService.get(id);
    }

    @GetMapping("/payment/timeout")
    public String timeout(){
        log.info("- - - - - in feign order payment/timeout - - - ");
        return paymentFeignService.feigntTimeOut();
    }

    @GetMapping("/payment/zipkin")
    public String zipkin() {
        log.info("- - - - - in feign order payment/zipkin - - - ");
        return paymentFeignService.zipkin();
    }

}
